package sz.szsmk.citizencard.ui.adapter;

import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.HotItemViewBinding;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/6/12 11:28
 * description:
 */
public class HomeHotItemAdapter extends RecyclerView.Adapter<HomeHotItemAdapter.HomeHotItemViewHolder> {


    @Override
    public int getItemViewType(int position) {
        return R.layout.hot_item_view;
    }

    @Override
    public HomeHotItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return HomeHotItemViewHolder.creat(parent);
    }

    @Override
    public int getItemCount() {
        return 2;
    }

    @Override
    public void onBindViewHolder(HomeHotItemViewHolder holder, int position) {
        loadItemData(position, holder.binding);
    }

    private void loadItemData(int position, HotItemViewBinding binding) {

    }

    static class HomeHotItemViewHolder extends RecyclerView.ViewHolder {

        private HotItemViewBinding binding;

        public static HomeHotItemViewHolder creat(ViewGroup parent) {

            HotItemViewBinding binding = HotItemViewBinding.inflate(LayoutInflater
                    .from((parent.getContext())), parent, false);
            return new HomeHotItemViewHolder(binding);
        }

        public HomeHotItemViewHolder(HotItemViewBinding binding) {
            super(binding.getRoot());
            this.binding = binding;
        }
    }
}
